package composite;

import javax.xml.xpath.XPath;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class Folder extends Directory{
    private List<Directory> dirs;
    public Folder(String name) {
        super(name);
        dirs=new ArrayList<>();
    }

    @Override
    public void show() {
        System.out.println(this.name);
        for(Directory directory:this.dirs){
            directory.show();
        }
    }
    public boolean add(Directory directory){
        return this.dirs.add(directory);
    }
    public boolean remove(Directory directory){
        return this.dirs.remove(directory);
    }
    public Directory get(int index){
        return this.dirs.get(index);
    }
}
